﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DAL;
using DataAccessComponents;
using System.Collections.ObjectModel;

namespace BusinessLogicLayer
{
    public class DaneFirmaBL : IBusinessLogicLayer<DaneFirma>
    {
        private DbOperations dal = new DbOperations();

        public int dodaj(DaneFirma objDodaj)
        {
            AdresBL adresBL = new AdresBL();
            objDodaj.Id_adres = adresBL.dodaj(objDodaj.Adres);
            
            return dal.dodajDaneFirma(objDodaj);            
        }

        public void usun(int idusun)
        {
            throw new NotImplementedException();
        }

        public void usun(string nazwa)
        {
            dal.usunDaneFirma(nazwa);
        }

        public void aktualizuj(DaneFirma objAktualizuj)
        {
            AdresBL adresBL = new AdresBL();
            adresBL.aktualizuj(objAktualizuj.Adres);
            dal.aktualizujDaneFirma(objAktualizuj);
        }

        public DaneFirma pobierz(int idpobierz)
        {
            throw new NotImplementedException();
        }

        public DaneFirma pobierz(string pobierz)
        {
            AdresBL adresBL = new AdresBL();
            DaneFirma df = dal.pobierzDaneFirma(pobierz);
            df.Adres = adresBL.pobierz(df.Id_adres);

            return df;
        } 
        public ObservableCollection<DaneFirma> pobierzListe()
        {
            throw new NotImplementedException();
        }

        public bool aktualizujListe(ObservableCollection<DaneFirma> lista)
        {
            throw new NotImplementedException();
        }

        public bool usun(ObservableCollection<DaneFirma> lista)
        {
            throw new NotImplementedException();
        }
    }
}
